import { useRouter, RouteLocationRaw, useRoute } from 'vue-router'

export function useRouterAction() {
    const router = useRouter()

    function push(to: RouteLocationRaw){
        router.push(to)
    }

    function replace(to: RouteLocationRaw){
        router.replace(to)
    }

    function back(){
        router.back()
    }

    function route() {
        return useRoute()
    }

    return {
        push, replace, route, router, back
    }
}